package com.mine.photohandler.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.mine.photohandler.R;
import com.mine.photohandler.base.AbsBaseAdapter;
import com.mine.photohandler.util.ImageBucket;

/**
 * 这个是显示一个文件夹里面的所有图片时用的适配器
 */
public class ImageFileAdapter extends AbsBaseAdapter<ImageBucket>{

    public ImageFileAdapter(Context context, boolean isNeedToRemember, int resid) {
        super(context, isNeedToRemember, resid);
    }

    @Override
    public void bindDatas(int position, View convertView, ViewHolder viewHolder, ImageBucket data) {
        viewHolder.bindTextView(R.id.name,data.bucketName)
                .bindTextView(R.id.filenum,data.count + "");
        Glide.with(context)
                .load(data.imageList.get(0).imagePath)
                .into((ImageView)viewHolder.getView(R.id.file_image));
    }
}
